How to know which fields of a record are updated in saving the edit? [closed]
Posted
by
Luiz Maffort
on Programmers
See other posts from Programmers
or by Luiz Maffort
Published on 2012-11-14T17:03:39Z
Indexed on
2012/11/14
23:17 UTC
Read the original article
Hit count: 398
I'm recording in a log table all that is changed in a given table, so this need to know when for example the User to change the status from active to inactive.
With this information I will write in my log table information of which record was changed, by whom and what was the value of old and new.
If I instantiate an object before:
db.Entry(chamados).State = EntityState.Modified;
I can even compare, but this error appears at runtime.
*An object with the same key already exists in the ObjectStateManager. The ObjectStateManager cannot track multiple objects with the same key. *
Podem me ajudar por favor?
© Programmers or respective owner